﻿using System.Web;
using System.Web.Mvc;

namespace Inovout.Web.Mvc
{
    public class AllowLocalAccessAttribute: AuthorizeAttribute
    {
        private static readonly string localIpAddress = "127.0.0.1";
        protected override bool AuthorizeCore(HttpContextBase httpContext)
        {
            return !httpContext.Request.UserHostAddress.Equals(localIpAddress);
        }
    }
}
